<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
   <?php echo $this->breadCrumbs(); ?>
  </div>
  <?php if (isset($error_warning)) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/product.png" alt="" /> <?php echo $_['heading_title']; ?></h1>
      <div class="buttons">
      <a onclick="$('#form').submit();" class="button"><?php echo $_['button_save']; ?></a>
      <a href="<?php echo UA('tool/collection'); ?>" class="button"><?php echo $_['button_cancel']; ?></a></div>
    </div>
    <div class="content">
      <div id="tabs" class="htabs">
      <a href="#tab-1">节点信息</a>
      <a href="#tab-2">内容规则</a>
      <a href="#tab-3">附加规则</a>
      <a href="#tab-4">选项</a>
      </div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
        <div id="tab-1">
           <table class="form">
			<tr>
				<td>网站</td>
				<td><input type="text" name="site_name" size="50" value="<?php echo $vo->get('site_name');?>"></td>
			</tr>
			<tr>
				<td>网址</td>
				<td><input type="text" name="site_url" size="50" value="<?php echo $vo->get('site_url');?>"></td>
			</tr>
			<tr>
				<td>节点名称</td>
				<td><input type="text" name="node_title" size="50" value="<?php echo $vo->get('node_title');?>"></td>
			</tr>
			<tr>
				<td>采集页面编码</td>
				<td><input type="text" name="page_charset" size="20" value="<?php echo $vo->get('page_charset', 'UTF-8');?>">
				<span class="help">ISO-8859-1/GB2312/GBK/UTF-8/BIG5...</span></td>
			</tr>
			<tr>
				<td>采集页面地址	</td>
				<td><textarea name="page_url" rows="6" cols="90"><?php echo $vo->get('page_url');?></textarea>
				<p>页码从 <input type="text" name="pageno_start" size="10" value="<?php echo $vo->get('pageno_start', 1);?>"> 到 
				<input type="text" name="pageno_end" size="10" value="<?php echo $vo->get('pageno_end');?>"></p>
				<p><span class="help">如：http://www.example.com/(*).html,页码使用(*)做为通配符。</span></p>
				</td>
			</tr>
			<tr>
				<td>网址配置(REG)</td>
				<td>网址中必须包含 <input type="text" name="url_contain" size="30" value="<?php echo $vo->get('url_contain');?>">
					网址中不得包含 <input type="text" name="url_except" size="30" value="<?php echo $vo->get('url_except');?>">
				</td>
			</tr>
			<tr>
				<td>获取网址</td>
				<td valign="top"> 开始：<textarea name="url_start" rows="6" cols="36"><?php echo str_replace('&', '&amp;', $vo->get('url_start'));?></textarea>
				结束：<textarea name="url_end" rows="6" cols="36"><?php echo str_replace('&', '&amp;', $vo->get('url_end'));?></textarea>
				</td>
			</tr>
			<tr>
				<td>列表页地址前缀</td>
				<td><input type="text" name="list_base" size="50" value="<?php echo $vo->get('list_base');?>"> <input type="checkbox" name="list_base_replace" value="1"<?php echo $vo->get('list_base_replace') ? ' checked' : '';?>> 替换主机部分</td>
			</tr>
			<tr>
				<td>内容页地址前缀</td>
				<td><input type="text" name="page_base" size="50" value="<?php echo $vo->get('page_base');?>"> <input type="checkbox" name="page_base_replace" value="1"<?php echo $vo->get('page_base_replace') ? ' checked' : '';?>> 替换主机部分</td>
			</tr>	
			</table>
        </div>
        <div id="tab-2">
          <table class="form">
			<tr>
				<td width="100">标题规则</td>
				<td valign="top"  width="600"> 匹配：<textarea name="name_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('name_rule'));?></textarea> 替换：<textarea name="name_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('name_filter'));?></textarea>
				</td>
				<td width="100">处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('name_func', $vo->get('name_func'));?>
				</td>
			</tr>
			<tr>
				<td>
					<br>编号规则
				</td>
				<td valign="top"> 匹配：<textarea name="sku_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('sku_rule'));?></textarea> 替换：<textarea name="sku_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('sku_filter'));?></textarea>
				</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('sku_func', $vo->get('sku_func'));?>
				</td>
			</tr>
			<tr>
				<td>
					<br>价格规则
				</td>
				<td valign="top"> 匹配：<textarea name="price_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('price_rule'));?></textarea> 替换：<textarea name="price_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('price_filter'));?></textarea>
				</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('price_func', $vo->get('price_func'));?>
				</td>
			</tr>
			<tr>
				<td>
					<br>重量规则
				</td>
				<td valign="top"> 匹配：<textarea name="weight_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('weight_rule'));?></textarea> 替换：<textarea name="weight_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('weight_filter'));?></textarea>
				</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('weight_func', $vo->get('weight_func'));?>
				</td>
			</tr>
			<tr>
				<td>
					<br>图片规则
				</td>
				<td valign="top"> 匹配：<textarea name="image_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('image_rule'));?></textarea> 替换：<textarea name="image_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('image_filter'));?></textarea>
				</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('image_func', $vo->get('image_func'));?>
				</td>
			</tr>
			<tr>
				<td>内容规则</td>
				<td valign="top"> 匹配：<textarea name="description_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('description_rule'));?></textarea> 替换：<textarea name="description_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;',$vo->get('description_filter'));?></textarea>
				</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('description_func', $vo->get('description_func'));?>
				</td>
			</tr>
		</table>
        </div>
        <div id="tab-3">
          <table class="form">
            <tr>
			<td width="100">
				<br><input type="text" name="other1_label" size="8" value="<?php echo $vo->get('other1_label', '其他1')?>">(255)
			</td>
			<td valign="top" width="600"> 匹配：<textarea name="other1_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('other1_rule'));?></textarea> 替换：<textarea name="other1_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;',$vo->get('other1_filter'));?></textarea>
			</td>
				<td width="100">处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('other1_func', $vo->get('other1_func'));?>
				</td>
		</tr>
		<tr>
			<td>
				<br><input type="text" name="other2_label" size="8" value="<?php echo $vo->get('other2_label', '其他2')?>">(255)
			</td>
			<td valign="top"> 匹配：<textarea name="other2_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('other2_rule'));?></textarea> 替换：<textarea name="other2_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;',$vo->get('other2_filter'));?></textarea>
			</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('other2_func', $vo->get('other2_func'));?>
				</td>
		</tr>
		<tr>
			<td>
				<br><input type="text" name="other3_label" size="8" value="<?php echo $vo->get('other1_label', '其他3')?>">(255)
			</td>
			<td valign="top"> 匹配：<textarea name="other3_rule" rows="6" cols="35"><?php echo str_replace('&', '&amp;', $vo->get('other3_rule'));?></textarea> 替换：<textarea name="other3_filter" rows="6" cols="35"><?php echo str_replace('&', '&amp;',$vo->get('other3_filter'));?></textarea>
			</td>
				<td>处理函数</td>
				<td valign="top">
				<?php echo Collection::functions('other3_func', $vo->get('other3_func'));?>
				</td>
		</tr>
          </table>
        </div>
        <div id="tab-4">
        	<table class="form">
        	<tr>
				<td>使用cURL</td>
				<td>
				<input type="checkbox" name="use_curl" value="1"<?php echo $vo->get('use_curl') ? ' checked' : '';?>>
				<?php if(!function_exists('curl_init')) { ?>
				<span class="red">不支持</span>
				<?php }?>
				</td>
			</tr>
			<tr>
				<td class="tl">Referer</td>
				<td><input type="text" name="referer" size="60" value="<?php echo $vo->get('referer'); ?>"></td>
			</tr>
            <tr>
				<td>是否下载图片</td>
				<td><input type="checkbox" name="down_image" value="1"<?php echo $vo->get('down_image', 1) ? ' checked' : '';?>> 				<span class="help">(入库时才会保存)</span></td>
			</tr>
			<tr>
				<td>采集记录数</td>
				<td> 采集前<input type="text" name="col_total" size="5" value="<?php echo $vo->get('col_total', 0);?>">条记录 <span class="help">("0"为不限，系统会从头采到页面尾)</span></td>
			</tr>
			<tr>
				<td>每组列表采集个数</td>
				<td> 每组采集<input type="text" name="col_per_list" size="5" value="<?php echo $vo->get('col_per_list', 5);?>">个列表页<span class="help">(防止采集超时)</span></td>
			</tr>
			<tr>
				<td>每组产品采集个数</td>
				<td> 每组采集<input type="text" name="col_per_cont" size="5" value="<?php echo $vo->get('col_per_cont', 5);?>">个信息页<span class="help">(防止采集超时)</span></td>
			</tr>
			<tr>
				<td>每组入库数</td>
				<td> 每组入<input type="text" name="col_per_imp" size="5" value="<?php echo $vo->get('col_per_imp', 10);?>">  条记录<span class="help">(防止入库超时。如果要下载图片可能需花费较长时间，可设置一个较小值。)</span></td>
			</tr>
			<tr>
				<td>每组采集时间间隔</td>
				<td> <input type="text" name="col_sleep" size="5" value="<?php echo $vo->get('col_sleep', 2);?>">  秒 <span class="help">(0为连续采集)</span></td>
			</tr>
			<tr>
				<td>线程数</td>
				<td> <input type="text" name="col_thread" size="5" value="<?php echo $vo->get('col_thread', 4);?>"></td>
			</tr>
          </table>
        </div>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script>
<?php echo $footer; ?>